<?php
/*!
 * LostKids PHP Library v0.1 
 * http://huali.li/
 *
 * Copyright 2011, 
 * Written By James Pang
 *  
 * Date: 2011/2/18
 */

require_once ('../configs.php');

/**
 * all user policies here
 */
class UserPoliciesImpl implements UserPolicies
{
    private $adaptor;
    
    public function __construct() {
        $this->adaptor = Assembly::getPlugins('MsgSrcAdaptor', true);
    }

    /**
     * 照片数需 >= app_minSeekerRegisterImg 
     */
	public function registerFaceSeeker($msg, $isNotify = false) {
        if(count(@$msg->ids) < app_minSeekerRegisterImg) {
            if($isNotify)
                $this->adaptor->replyMsg($msg, ResourceBundle::getMsg(
                    'pol_registerFaceSeeker', app_minSeekerRegisterImg));
            return false;
        }
        return true;
	}

    /**
     * 照片数需 >= app_minReporterRegisterImg
     */
	public function registerFaceReportor($msg, $isNotify = false) {
        if(count(@$msg->ids) < app_minSeekerRegisterImg) {
            if($isNotify)
                $$this->adaptor->replyMsg($msg, ResourceBundle::getMsg(
                    'pol_registerFaceReportor', app_minSeekerRegisterImg));
            return false;
        }
        return true;
	}
}
?>
